#!usr/bin/python
# -*- coding: UTF-8 -*-
num = {}
print(type(num))

num2 = {1, 2, 3, 4, 5}
print(type(num2))

set1 = set([1, 2, 3, 4, 5, 5])
print(set1)

'''
练习 要求：去掉列表中重复的元素
[0, 1, 2, 3, 4, 5, 5, 3, 1]
'''
num1 = [0, 1, 2, 3, 4, 5, 5, 3, 1]
temp = []
for each in num1:
    if each not in temp:
        temp.append(each)
print('去重后', temp)

num1 = [0, 1, 2, 3, 4, 5, 5, 3, 1]
print('num1', num1)
print('set(num1)', (set(num1))) #教程说，使用set得到的结果是无序的
print(list(set(num1)))

num2 = {0, 1, 2, 3, 4, 5}
print(1 in num2)
print(12 in num2)
print(type(num1))
print(type(num2))
print(num2)
a = num2.add(6)
print(num2)
print(num2)
a = num2.remove(5)
print(num2)
print(a)

num3 = frozenset([1, 2, 3, 4, 5]) #加完以后就不可变
print('num3', num3)

num3.add(3) #报错，不可修改！！！







